<template>
	<el-dialog :title="title" class="el-dialog" v-model="isShowDialog" width="550px" align="center">
		<el-card shadow="hover" body-style="padding:8px; ">
				<el-input v-model="content"  type="textarea" :rows="10" style="width:680px;" placeholder="请输入..."></el-input>
		</el-card>
		<template #footer>
			<span class="dialog-footer">
				<el-button @click="onCancel" size="small">取 消</el-button>
			</span>
		</template>
	</el-dialog>
</template>

<script lang="ts">
import {  reactive, toRefs } from 'vue';

export default {
	components: {},
	setup() {
		const state = reactive({
			title:'发送内容',
			isShowDialog: false,
			content: '',
		});
		// 打开弹窗
		const openDialog = (content:string,title:string) => {
			state.title=title;
			state.content=content;
			state.isShowDialog = true;
		};
		// 关闭弹窗
		const closeDialog = () => {
			state.isShowDialog = false;
		};
		// 取消
		const onCancel = () => {
			closeDialog();
		};
		return {
			openDialog,
			onCancel,
			...toRefs(state),
		};
	},
};
</script>
